<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('tx:send-article')->hourly()->environments(['production']);   // 每小时发一篇文章
        $schedule->command('tx:crawler')->everyFiveMinutes()->environments(['staging']);  // 每二十分钟执行一次采集
        $schedule->command('tx:dl-pic')->everyMinute()->environments(['staging']);
        $schedule->command('horizon:snapshot')->everyFiveMinutes()->environments(['staging']);
        $schedule->command('tx:get-pictuer-average')->everyMinute()->environments(['staging']);
        $schedule->command('tx:create-hot-tags')->cron('15 3,6,9,12,15,18,21 * * *')->environments(['production']);
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
